﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace sgca.UrlBuilder
{
    public class Samples
    {
        public static void Main(string[] args)
        {
            Simple();
            Complexer();
            Erratic();
            Console.ReadLine();
        }

        public static void Simple()
        {
            UrlBuilder ub = new UrlBuilder("http://www.google.com")
                .AddPart("int")
                .AddPart("en")
                .AddPart("ads");
            Debug.WriteLine(ub.ToString());
        }

        public static void Complexer()
        {
            UrlBuilder ub = new UrlBuilder("www.somesite.com///")
                .AddPart("//news/")
                .AddPart("recent/")
                .AddPart("/local")
                .AddPart("/item.aspx//")
                .AddQueryString("ID", "kjhnb3");
            Debug.WriteLine(ub.ToString());
        }

        public static void Erratic()
        {
            UrlBuilder ub = new UrlBuilder("www.somesite.com///")
                .AddPart("//news/")
                .AddQueryString("ID", "kjhnb3")
                .AddPart("recent/")
                .AddPart("/local")
                .AddPart("")
                .AddPart("/item.aspx//")
                .AddQueryString("WAT?", "");
            Debug.WriteLine(ub.ToString());
        }
    }
}
